
<div class="layui-form" lay-filter="layuiadmin-form-admin" style="padding: 20px 30px 0 0;">

    <div class="layui-form-item">
        <label class="layui-form-label">选择美食</label>
        <div class="layui-input-block">
            <select name="meishi" lay-verify="name2" class="meishi" >
                <option value=""></option>

            </select>
        </div>
    </div>
    <div class="layui-form-item">
    <label class="layui-form-label">选择酒店</label>
    <div class="layui-input-block">
        <select name="jiudian" lay-verify="name2" class="jiudian" >
            <option value=""></option>

        </select>
    </div>
</div>
    <div class="layui-form-item">

        <div class="layui-form-item">
            <label class="layui-form-label"></label>
            <div class="layui-input-inline">
                <input type="button" lay-submit lay-filter="LAY-user-back-submit" value="确认" class="layui-btn">
            </div>
        </div>
    </div>

    <script>
        layui.use(['admin', 'form'], function(){
            var $ = layui.$
                ,form = layui.form;

            $.ajax({
                url:'http://api.map.baidu.com/place/v2/search?output=json&ak=QLhpW9jVIw43LiqUoDI48x84oGkUFPl5',
                data:{query:"美食",region:parent.PartitionId},
                dataType:'JSONP',
                success:function (data) {
                    console.log(data.results);
                    for (var i = 0;i< data.results.length;i++){
                       // $(".layui-anim").append("<dd lay-value="+data.results[i].name+" class>"+data.results[i].name+"</dd>");
                        $(".meishi").append("<option value="+data.results[i].name+">"+data.results[i].name+"</option>");

                        console.log("执行1");
                    }
                    form.render('select');
                }
            });
            $.ajax({
                url:'http://api.map.baidu.com/place/v2/search?output=json&ak=QLhpW9jVIw43LiqUoDI48x84oGkUFPl5',
                data:{query:"酒店",region:parent.PartitionId},
                dataType:'JSONP',
                success:function (data) {
                    console.log(data.results);
                    for (var i = 0;i< data.results.length;i++){
                        // $(".layui-anim").append("<dd lay-value="+data.results[i].name+" class>"+data.results[i].name+"</dd>");
                        $(".jiudian").append("<option value="+data.results[i].name+">"+data.results[i].name+"</option>");

                        console.log("执行1");
                    }
                    form.render('select');
                }
            });

        });


/*$(function () {
    $.ajax({
        url:'http://api.map.baidu.com/place/v2/search?output=json&ak=QLhpW9jVIw43LiqUoDI48x84oGkUFPl5',
        data:{query:"美食",region:"重庆"},
        dataType:'JSONP',
        success:function (data) {
            console.log(data.results);
            for (var i = 0;i< data.results.length;i++){
                $(".layui-anim").append("<dd lay-value="+data.results[i].name+" class>"+data.results[i].name+"</dd>");
                $(".jiudian").append("<option value="+data.results[i].name+">"+data.results[i].name+"</option>");

                console.log("执行1");
            }
            form.render('select');
        }
    });
})*/

    </script>